#pragma once
#include "tcp_socket.hpp"

class TcpClient
{
	private:
		TcpSocket sock_;
		std::string ip_;
		uint16_t port_;
	public:
		TcpClient(const std::string& ip,uint16_t port):ip_(ip),port_(port)
	{
		sock_.Socket();
	}
		~TcpClient()
		{
			sock_.Close();
		}
		bool Connect()
		{
			return sock_.Connect(ip_,port_);
		}
		bool Recv(std::string* buf)
		{
			return sock_.Recv(buf);
		}
		bool Send(const std::string& buf)
		{
			return sock_.Send(buf);
		}
};
